#include"personList.h"

int main()
{
    Employee employee(0, "Tom", "male", "会计师");
    Teacher teacher(1, "Andy", "female", "数学");
    Student student(2, "Job", "male", 3);

    PersonList myList;

    // 插入
    cout << "异质链表插入" << endl;
    myList.Insert(&student);
    myList.Insert(&employee);
    myList.Insert(&teacher);

    // 遍历
    cout << "异质链表遍历" << endl;
    myList.Print();
 
    // 查找
    cout << "异质链表查找" << endl;
    myList.Find(1);
    myList.Find(3);

    // 删除
    cout << "异质链表删除" << endl;
    myList.Delete(0);
    myList.Print();
    cout << endl;
    myList.Delete(1);
    myList.Print();
    cout << endl;
    myList.Delete(2);
    myList.Print();

    return 0;
}
